import { createRouter, createWebHistory } from 'vue-router'
import Login from '@/components/Login/Login.vue'
import Layout from '@/components/Layout/Layout.vue'
import Home from '@/components/Home/Home.vue'

const Order = () => import('@/components/Order/Order.vue')
const Params = () => import('@/components/Params/Params.vue')
const User = () => import('@/components/User/User.vue')
const Cert = () => import('@/components/Cert/Cert.vue')
const Goods = () => import('@/components/Goods/Goods.vue')
const Advert = () => import('@/components/Advert/Advert.vue')



const routes = [
  {
    path: '/',
    component: Layout,
    children: [
      {
        path: '/home',
        name: 'Home',
        component: Home
      },{
        path: '/order',
        name: 'Order',
        component: Order
      },{

        path: '/params',
        name: 'Params',
        component: Params
      },{
        path: '/user',
        name: 'User',
        component: User
      },{
        path: '/cert',
        name: 'Cert',
        component: Cert
      },{
        path: '/goods',
        name: 'Goods',
        component: Goods
      },{
        path: '/advert',
        name: 'Advert',
        component: Advert
      }
    ]
  },{
    path: '/login',
    name: 'Login',
    component: Login
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router